package day10;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Menu {
    public static void main(String[] args) {
        System.out.println("*******菜单选择");
        Scanner input = new Scanner(System.in);
        while (true) {
            System.out.println("1 登录 2 注册 3 联系客服");
            try {
                int nums = input.nextInt();
                switch (nums) {
                    case 1:
                        System.out.println("登录");
                        break;
                    case 2:
                        System.out.println("注册");
                        break;
                    case 3:
                        System.out.println("联系客服");
                        break;
                    default:
                        System.out.println("输入错误，重新输入");
                        continue;
                }
            } catch (Exception e) {
                System.out.println("输入错误，重新输入");
                input.next();//!!!!
                continue;
            }
            break;
        }
    }
}
